2007-08-03

摩天大樓推理

這是摩天大樓 (Skyscrapers)的問題,入門的練習題。
題目:每一個格子代表一棟大樓。格子上的數字代表該大樓的樓高。大樓的高度從一層樓到四層樓不等 (好奇怪,不是摩天大樓嗎),每一列及每一行中的大樓中,不會有樓高相同的情形出現。在整個外框中所標示的數字及箭頭,代表由這個箭頭方向看過去,可以看得到的大樓數目。
注意,樓層高的大樓會擋住較低大樓的視線,所以會看不到在它之後的大樓。

問題:填入每一個格子的數字。
題目原文:Find the heights of all the buildings in the grid, one per cell. Buildings range in height from 1 to 4 floors, with no height being repeated in any row or column. A number outside the grid indicates the number of buildings seen from that point along the corresponding row or column. Note that taller buildings hide shorter buildings. For example, any building of height 4 would block the view of all the buildings behind it.

解答篇:

張貼留言

Whatsapp Button works on Mobile Device only

Start typing and press Enter to search